{template head}
<script>
	function searchTZ(p)
	{
		$('#tzPage').val(p);
		getTZList();
	}
	
	function searchJY(p)
	{
		$('#jyPage').val(p);
		getJYList();
	}
	
	function tabJY(type,obj)
	{
		$('#jyTab>li').each(function(){
			$(this).removeClass();
		})
		$(obj).addClass('layui-this');
		$('#jyType').val(type);
		$('#jyPage').val(1);
		getJYList();
	}
	
	function tabTZ(type,obj)
	{
		$('#tzTab>li').each(function(){
			$(this).removeClass();
		})
		$(obj).addClass('layui-this');
		$('#tzType').val(type);
		$('#tzPage').val(1);
		getTZList();
	}
	
	function getTZList()
	{
		layer.load();
		var url = '{SITE_URL}ajax/index.php?m=getTZList';
		var data = {};
		data.type = $('#tzType').val();
		data.page = $('#tzPage').val();
		data.userid = '{$parm[id]}';
		var callback = function(data)
		{
			if(data.sign == '1')
			{
				var getTpl = $('#touzi_temp').html();
				laytpl(getTpl).render(data, function(html){
				  	$('#touzi_list').html(html);
				});
				
				var pageTpl = $('#touzi_page_temp').html();
				laytpl(pageTpl).render(data, function(html){
				  	$('#touzi_page').html(html);
				});
			}
			else
			{
				layer.msg(data.msg);
			}
			
			layer.closeAll('loading');
		};
		makeAjax('post',url,data,callback);
	}
	
	function getJYList()
	{
		layer.load();
		
		var url = '{SITE_URL}ajax/index.php?m=getJYList';
		var data = {};
		data.type = $('#jyType').val();
		data.page = $('#jyPage').val();
		data.userid = '{$parm[id]}';
		var callback = function(data)
		{
			if(data.sign == '1')
			{
				var getTpl = $('#jiaoyi_temp').html();
				laytpl(getTpl).render(data, function(html){
				  	$('#jiaoyi_list').html(html);
				});
				
				var pageTpl = $('#jiaoyi_page_temp').html();
				laytpl(pageTpl).render(data, function(html){
				  	$('#jiaoyi_page').html(html);
				});
			}
			else
			{
				layer.msg(data.msg);
			}
			
			layer.closeAll('loading');
		};
		makeAjax('post',url,data,callback);
	}
	
	function resetPwd()
	{
		layer.load();
		
		var url = '{SITE_URL}ajax/index.php?m=resetPwd';
		var data = {};
		data.userid = '{$parm[id]}';
		var callback = function(data)
		{
			if(data.sign == '1')
			{
				layer.closeAll();
				
				layer.alert(data.msg,function(){
					window.location = window.location;
				});
			}
			else
			{
				layer.msg(data.msg);
			}
			
			layer.closeAll('loading');
		};
		makeAjax('post',url,data,callback);
	}
	
	function jbBank()
	{
		layer.load();
		
		var url = '{SITE_URL}ajax/index.php?m=jbBank';
		var data = {};
		data.userid = '{$parm[id]}';
		var callback = function(data)
		{
			if(data.sign == '1')
			{
				layer.closeAll();
				
				layer.alert(data.msg,function(){
					window.location = window.location;
				});
			}
			else
			{
				layer.msg(data.msg);
			}
			
			layer.closeAll('loading');
		};
		makeAjax('post',url,data,callback);
	}
	
	function jbAliPay()
	{
		layer.load();
		
		var url = '{SITE_URL}ajax/index.php?m=jbAliPay';
		var data = {};
		data.userid = '{$parm[id]}';
		var callback = function(data)
		{
			if(data.sign == '1')
			{
				layer.closeAll();
				
				layer.alert(data.msg,function(){
					window.location = window.location;
				});
			}
			else
			{
				layer.msg(data.msg);
			}
			
			layer.closeAll('loading');
		};
		makeAjax('post',url,data,callback);
	}
</script>
<body>
<div class="wrapper">
	<div class="crumbs"><a href="javascript:;">用户管理</a> &gt;<a id="gotoList" href="{SITE_URL}index.php?a=userM&m=list">用户列表</a> &gt; <span>查看用户信息</span><a style="float:right;font-size:13px;" href="javascript:history.go(-1);">返回</a></div>
	<div class="container_tit clearfix mb20 ft14">
		
	<form id="savedata">
		<input type="hidden" name="id" value="{$info[id]}" />
		<h2 class="form_tit">
			个人信息
			{if adminpermission('Y','100000','100005')}
			<a onclick="resetPwd();" href="javascript:;" class="btnblue mr15 fr">重置密码</a>
			{/if}
				
			<!--<a href="javascript:;" class="btnblue mr15">修改手机号</a>-->
		
		</h2>
		<div class="form_item clearfix">
			<p class="clearfix">
				<label class="name">手机号：</label>
				<label style="display: inline-block;line-height: 30px;height: 30px;width: 150px;">{$info[loginname]}&nbsp;</label>
				<label class="name">注册来源：</label>
				<label style="display: inline-block;line-height: 30px;height: 30px;width: 150px;">{$info[source]}&nbsp;</label>
		    </p>
		    <p class="clearfix">
				<label class="name">姓名：</label>
				<label style="display: inline-block;line-height: 30px;height: 30px;width: 150px;">{$info[name]}&nbsp;</label>
		   		<label class="name">身份证号：</label>
				<label style="display: inline-block;line-height: 30px;height: 30px;width: 150px;">{$info[idcard]}&nbsp;</label>
		    </p>
		    <p class="clearfix">
				<label class="name">注册时间：</label>
				<label style="display: inline-block;line-height: 30px;height: 30px;width: 150px;">{php echo time_formart($info['regtime'],2)}&nbsp;</label>
				<label class="name">最后登录时间：</label>
				<label style="display: inline-block;line-height: 30px;height: 30px;width: 150px;">{php echo time_formart($info['lasttime'],2)}&nbsp;</label>
		    </p>
		</div>
		<h2 class="form_tit">
			提现信息
			{if adminpermission('Y','100000','100006')}
			<a onclick="jbAliPay();" href="javascript:;" class="btnblue mr15 fr">解绑支付宝</a>
			<a onclick="jbBank();" href="javascript:;" class="btnblue mr15 fr">解绑银行卡</a>
			{/if}
		</h2>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">开户银行：</label>
				<label style="display: inline-block;line-height: 30px;height: 30px;width: 150px;">{$bankName}&nbsp;</label>
				<label class="name">银行卡号：</label>
				<label style="display: inline-block;line-height: 30px;height: 30px;width: 150px;">{$bankCode}&nbsp;</label>
				<label class="name">支行名称：</label>
				<label style="display: inline-block;line-height: 30px;height: 30px;width: 150px;">{$bank['bankNameZH']}&nbsp;</label>
		    </p>
		    <p class="clearfix">
				<label class="name">支付宝号：</label>
				<label style="display: inline-block;line-height: 30px;height: 30px;width: 150px;">{$alipayCode}&nbsp;</label>	
		    	<label class="name">支付宝昵称：</label>
				<label style="display: inline-block;line-height: 30px;height: 30px;width: 150px;">{$alipay['nickName']}&nbsp;</label>
		    </p>
		</div>
		<h2 class="form_tit">返利信息</h2>
		<div class="form_item clearfix">
		    <p class="clearfix">
				<label class="name">返利余额：</label>
				<label style="display: inline-block;line-height: 30px;height: 30px;width: 150px;">{$flye}&nbsp;</label>
				<label class="name">今日返利：</label>
				<label style="display: inline-block;line-height: 30px;height: 30px;width: 150px;">{$jrfl}&nbsp;</label>
		    </p>
		    <p class="clearfix">
				<label class="name">累积返利：</label>
				<label style="display: inline-block;line-height: 30px;height: 30px;width: 150px;">{$ljfl}&nbsp;</label>	
		    </p>
		</div>
		<h2 class="form_tit">投资记录</h2>
		<input type="hidden" name="tzType" id="tzType" value="1" />
		<input type="hidden" name="tzPage" id="tzPage" value="1" />
		<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
		  	<ul class="layui-tab-title" id="tzTab">
		   	 	<li class="layui-this" onclick="tabTZ('1',this);">待确认</li></a>
		    	<li onclick="tabTZ('2',this);">已投标</li></a>
			    <li onclick="tabTZ('3',this);">未投标</li></a>
		  	</ul>
		</div>  
		<!-- list -->
		<table class="table">
			<thead>
				<th width="">平台</th>
				<th width="">产品</th>
				<th width="">期限</th>
				<th width="">时间</th>
				<th width="">状态</th>
			</thead>
			<script id="touzi_temp" type="text/html">
				{{# layui.each(d.list, function(index, item){ }}
					<tr>
						<td style="text-align: center;">{{item.pt_name}}</td>
						<td style="text-align: center;">{{item.cp_name}}</td>
						<td style="text-align: center;">{{item.qixian}}</td>
						<td style="text-align: center;">{{item.tztime}}</td>
						<td style="text-align: center;">
							{{item.status}}
						</td>
					</tr>
				{{# }); }}
			</script>
			<script id="touzi_page_temp" type="text/html">
				<a onclick="searchTZ('1');" href="javascript:;">首页</a>
				<a onclick="searchTZ('{{d.page._prepage}}');" href="javascript:;">上一页</a>
				{{# layui.each(d.page.pagelist, function(index, item){ }}
					{{# if(item.p === d.page._page){ }}	
						<a onclick="searchTZ('{{item.p}}');" class="current" href="javascript:;">{{item.p}}</a>
					{{# } else { }}
						<a onclick="searchTZ('{{item.p}}');" href="javascript:;">{{item.p}}</a>
					{{#  } }}
				{{# }); }}
				<a onclick="searchTZ('{{d.page._nextpage}}');" href="javascript:;">下一页</a>
				<a onclick="searchTZ('{{d.page._totlepage}}');" href="javascript:;">尾页</a>
			</script>
			<tbody id="touzi_list">
			</tbody>
		</table>
		<div style="padding-top:10px;" id="touzi_page" class="d_page"></div>
		
		
		<h2 class="form_tit">资金明细</h2>
		<input type="hidden" name="jyType" id="jyType" value="" />
		<input type="hidden" name="jyPage" id="jyPage" value="1" />
		<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
		  	<ul class="layui-tab-title" id="jyTab">
		   	 	<li class="layui-this" onclick="tabJY('',this);">全部</li>
		    	<li onclick="tabJY('1',this);">返利</li>
			    <li onclick="tabJY('2',this);">提现</li>
		  	</ul>
		</div>
		<!-- list -->
		<table class="table">
			<thead>
				<th width="">交易类型</th>
				<th width="">时间</th>
				<th width="">变动金额(元)</th>
				<th width="">账户余额(元)</th>
			</thead>
			<script id="jiaoyi_temp" type="text/html">
				{{# layui.each(d.list, function(index, item){ }}
					<tr>
						<td style="text-align: center;">{{item.title}}</td>
						<td style="text-align: center;">{{item.time}}</td>
						<td style="text-align: center;">{{item.money}}</td>
						<td style="text-align: center;">{{item.yue}}</td>
					</tr>
				{{# }); }}
			</script>
			<script id="jiaoyi_page_temp" type="text/html">
				<a onclick="searchJY('1');" href="javascript:;">首页</a>
				<a onclick="searchJY('{{d.page._prepage}}');" href="javascript:;">上一页</a>
				{{# layui.each(d.page.pagelist, function(index, item){ }}
					{{# if(item.p === d.page._page){ }}	
						<a onclick="searchJY('{{item.p}}');" class="current" href="javascript:;">{{item.p}}</a>
					{{# } else { }}
						<a onclick="searchJY('{{item.p}}');" href="javascript:;">{{item.p}}</a>
					{{#  } }}
				{{# }); }}
				<a onclick="searchJY('{{d.page._nextpage}}');" href="javascript:;">下一页</a>
				<a onclick="searchJY('{{d.page._totlepage}}');" href="javascript:;">尾页</a>
			</script>
			<tbody id="jiaoyi_list">
			</tbody>
		</table>
		<div style="padding-top:10px;" id="jiaoyi_page" class="d_page"></div>
    </form>
    </div>
</div>
</body>

<script>
	getTZList();
	getJYList();
</script>

{template foot}
